package ru.ifmo.cppsc.auxilary;

import java.io.*;

/**
 * Created by IntelliJ IDEA.
 * User: orybak
 * Date: 30.06.2008
 * Time: 1:02:54
 * To change this template use File | Settings | File Templates.
 */
public class FileHelper {
    public static String getFileContents(String fileName) {

        StringBuilder sb = new StringBuilder("");
        BufferedReader br;
        String s;
        String result = "";

        try {
            File f = new File(fileName);
            System.out.println("Reading contents of [" + f.getCanonicalPath() + "]");
            br = new BufferedReader(new FileReader(f));
            while ((s = br.readLine()) != null) {
                sb.append(s).append('\n');
            }
            result = sb.toString();
        } catch ( FileNotFoundException e ) {
        } catch (IOException e) {
        }
        return result;
    }
}
